MPT.addTmpl('microblog', function(_data) {

    var html = [];

    html.push('    <div class="wb_content e_microblog">');
    html.push('        <div class="e_microblog_list"></div>');
    html.push('        <div class="blank"></div>');
    html.push('        <div class="more e_microblog_page" title="">更多动态加载中↓</div>');
    html.push('    </div>');

    return html.join('');
});


MPT.addTmpl('one_microblog', function(_data) {

    var html = [];

    var commentNum, content = "", delReason, id, imgName, ip, musicName, parentId, publishNickname, publishTime, publishUserId, status, topBlog, topBlogId, transBlog, transNum, videoName, sysTime, publishImage;
    var zcommentNum, zcontent = "", zdelReason, zid, zimgName, zip, zmusicName, zparentId, zpublishNickname, zpublishTime, zpublishUserId, zstatus, ztopBlog, ztopBlogId, ztransBlog, ztransNum, zvideoName, zsysTime, zpublishImage;
    var blogType;

    commentNum = _data.commentNum;
    content = _data.content;
    delReason = _data.delReason;
    id = _data.id;
    imgName = _data.imgName;
    ip = _data.ip;
    musicName = _data.musicName;
    parentId = _data.parentId;
    publishTime = _data.publishTime;    
    publishNickname = _data.publishNickname;
    publishUserId = _data.publishUserId;
    //大家都在说字段名称不同，需要重新作调整
    if (!publishNickname) publishNickname = _data.publishNickName;
    if (!publishUserId) publishUserId = _data.publishUserID;
    status = _data.status;
    topBlogId = _data.topBlogId;
    transBlog = _data.transBlog;
    transNum = _data.transNum;
    videoName = _data.videoName;
    sysTime = _data.sysTime;
    publishImage = Util.avatarPath(publishUserId, 33);
    topBlog = _data.topBlog;
    blogType = _data.blogType;
    spacePath = Util.spacePath(publishUserId);



    //“我的空间动态”和“@提到我的”，添加ID，在删除评论时使用
    if (blogType != 0) {
        html.push("<dl class='wb clrfix e_one_blog'>");
    } else {
        html.push("<dl class='wb clrfix'>");
    }

    //微博内容
    html.push("<dt class='face'><a href='" + spacePath + "''><img src='" + publishImage + "' alt='' /></a></dt> ");
    html.push("<dd class='wb_center e_blog_body'> ");
    html.push("<h2 class='logo'><a class='name' href='" + spacePath + "''>" + publishNickname + " 【飞龙在天-电信】：</a></h2>");
    html.push("<p class='pt_10 e_content'>" + Util.escapeContent(content) + "</p> ");

    //转发微博区域
    if (topBlog != null) {

        zpublishUserId = topBlog.publishUserId;

        if (zpublishUserId == null || zpublishUserId == undefined) {

            //temp_wbDIV[j++] = "<div class='comment_content'>此微博已被原作者删除。</div>";
        } else {
            zcommentNum = topBlog.commentNum;
            zcontent = topBlog.content;
            zdelReason = topBlog.delReason;
            zid = topBlog.id;
            zimgName = topBlog.imgName;
            zip = topBlog.ip;
            zmusicName = topBlog.musicName;
            zparentId = topBlog.parentId;
            zpublishNickname = topBlog.publishNickname;
            zpublishTime = topBlog.publishTime;
            zstatus = topBlog.status;
            ztopBlogId = topBlog.topBlogId;
            ztransBlog = topBlog.transBlog;
            ztransNum = topBlog.transNum;
            zvideoName = topBlog.videoName;
            zsysTime = topBlog.sysTime;
            zpublishImage = topBlog.publishImage;
            zspacePath = Util.spacePath(zpublishUserId);

            // 转发内容
            html.push("<div class='zf_main'>");
            html.push("<h2 class='logo'><a class='name' href='" + zspacePath + "'>" + zpublishNickname + "【飞龙在天-电信】：</a></h2>");
            html.push("<p class='pt_10 e_trans_content'>" + Util.escapeContent(zcontent) + "</p>");
            html.push("<p class='pt_10 t_r'><strong class='gray'>" + Util.specialDateTime(zsysTime, zpublishTime) + "</strong> ");
            html.push("<strong class='gray' title='评论'>评论（<em>" + zcommentNum + "</em>）</strong> ");
            html.push("<strong class='gray' title='转发'>转发（<em>" + ztransNum + "</em>）</strong></p>");
            html.push("</div>");
        }
    }

    //“大家”没有操作微博的功能
    if (blogType != 0) {

        html.push("<p class='pt_10 t_r'>");
        html.push("<strong>" + Util.specialDateTime(sysTime, publishTime) + "</strong>");

        //“我的动态”和“@提到我”，额外具有删除微博的功能
        if (blogType == 2 || blogType == 3) {
            //temp_wbDIV[j++] = "<div id='delid" + id + "' style='display:none' ><a title='删除'>删除</a> | </div>";
        }

        html.push("<a class='center_btn e_comment' title='评论'>评论<em>(" + commentNum + ")</em></a>");
        html.push('<a class="center_btn e_transfer" title="转发">转发<em>(' + transNum + ')</em></a> ');
    }

    html.push("</p> ");
    html.push("</dd>");
    html.push("</dl>");

    return html.join('');
});


MPT.addTmpl('comment_list', function(_data) {

    var html = [];

    html.push('<div class="hf e_comment_list">');
    html.push('    <div class="line"></div>');
    html.push('    <div class="block1">◆</div>');
    html.push('    <div class="block2 e_comment_after">◆</div>');

    $.each(_data, function(_i, _d) {

        html.push(MPT.getTmpl('one_comment', _d));
    });

    html.push('<input class="inp1 mt_10 e_comment_add" type="text" name="" id="" value="添加评论...">');

    html.push('<div class="input_main pt_10 e_comment_expand">');
    html.push('    <div class="input_box">');
    html.push('        <textarea class="inp3 e_input" name="" id="" cols="20" rows="4"></textarea>');
    html.push('        <p class="t_r nub"><span class="e_count">0</span>/150</p>');
    html.push('    </div>');
    html.push('    <div class="release_box">');
    html.push('        <ul class="release_btn">');
    html.push('            <li><a class="e_cancel" title="取消">取消</a></li>');
    html.push('            <li><div class="btn1_30"><input class="btn2_30 sub_btn e_submit" type="submit" value="发表评论" title="发表评论"></div></li>');
    html.push('        </ul>');
    html.push('        <ul class="pic">');
    html.push('            <li class="pic_face e_op_emotion" title="表情">表情</li>');
    html.push('        </ul>');
    html.push('        <div class="emotion e_emotion"></div>');
    html.push('    </div>');
    html.push('</div>');

    return html.join('');

});

MPT.addTmpl('one_comment', function(_data) {

    var html = [];
    var spacePath = Util.spacePath(_data.commentUserId);
    var imagePath = Util.avatarPath(_data.commentUserId, 16);

    html.push('    <dl id="com_' + _data.id + '" nick="' + _data.nickName + '" class="hf_content pt_10 e_one_comment">');
    html.push('        <dt class="hf_face"><a href="' + spacePath + '">');
    html.push('            <img src="' + _data.commentImage + '"></a> </dt>');
    //html.push('            <img src="' + imagePath + '"></a> </dt>');
    html.push('        <dd class="hf_center">');
    html.push('            <p>');
    html.push('                <a class="name" href="' + spacePath + '">' + _data.nickName + '</a>');
    html.push('                 ：<em>' + Util.escapeContent(_data.content) + '</em></p>');
    html.push('            <p>');
    html.push(Util.specialDateTime(_data.sysTime, _data.commentTime));
    html.push('                <a class="center_btn e_reply" title="回复">回复</a></p>');
    html.push('        </dd>');
    html.push('    </dl>');

    return html.join('');

});

MPT.addTmpl('transpond_main', function(_data) {

    var html = [];
    var blogID = _data.blogID;
    var content = _data.content;
    var nickname = "@" + _data.nickname;
    var trans_content = _data.transcontent;

    html.push('<div class="comment_transpond pt_10 e_comment_transpond">');
    html.push('    <h2 class="zf_if">您将转发 ');
    html.push('       <em class="name">' + Util.nickNameContent(nickname) + '</em>：');
    html.push(Util.escapeContent(content));
    html.push('    </h2>');
    html.push('    <div class="input_box">');
    html.push('        <textarea class="inp3 e_input" cols="20" rows="4"></textarea>');
    html.push('        <p class="t_r nub"><span class="e_count">0</span>/150</p>');
    html.push('    </div>');
    html.push('    <div class="release_box">');
    html.push('        <ul class="release_btn">');
    html.push('            <li><input class="inp4 e_set_comment" type="checkbox">同时评论</li>');
    html.push('            <li><a class="e_cancel e_cancel" title="取消">取消</a></li>');
    html.push('            <li><div class="btn1_30"><input class="btn2_30 sub_btn e_submit" type="button" value="转  发" title="转发"></div></li>');
    html.push('        </ul>');
    html.push('        <ul class="pic">');
    html.push('            <li class="pic_face e_op_emotion" title="表情">表情</li>');
    html.push('            <li class="pic_friend e_op_friend" title="朋友">朋友</li>');
    html.push('        </ul>');
    html.push('        <div class="emotion e_emotion"></div>');
    html.push('        <div class="friend e_friend"></div>');
    html.push('    </div>');
    html.push('</div>');

    return html.join('');

});